/**
 * 文件名称:StorageDaoImpl.java
 * 文件版权:ChinaParasol Technologies Co., Ltd. Copyright 1998-2020, All rights reserved
 * 文件描述:<描述>
 * 修改作者:LiXiangDong
 * 修改时间:Jan 8, 2013
 */
package com.parasol.hcerp.service.storage.dao.impl;

import java.util.List;

import com.parasol.hcerp.common.jdbc.ParasolSQLSuport;
import com.parasol.hcerp.service.storage.dao.StorageDao;
import com.parasol.hcerp.service.storage.domain.StorageBean;
import com.parasol.hcerp.service.storage.domain.StorageParameBean;
import com.parasol.hcerp.service.storage.domain.StorageShowBean;

/**
 * 
 * @author  LiXiangDong
 * @version V1.0
 */
public class StorageDaoImpl implements StorageDao
{ 
    
    private ParasolSQLSuport parasolSQLSuport = null;
    
    public ParasolSQLSuport getParasolSQLSuport()
    {
        return parasolSQLSuport;
    }

    public void setParasolSQLSuport(ParasolSQLSuport parasolSQLSuport)
    {
        this.parasolSQLSuport = parasolSQLSuport;
    }

    public void deleteForStorage(String storageid)
    {
        parasolSQLSuport.delete("storage.deleteForStorage", storageid);
    }
    
    public StorageShowBean queryForStorage(String storageid)
    {
        return (StorageShowBean)parasolSQLSuport.queryForObject("storage.queryForStorage", storageid);
    }
    
    public int queryForStorageExist(StorageBean storageBean)
    {
        String result = String.valueOf(parasolSQLSuport.queryForObject("storage.queryForStorageExist", storageBean));
        return Integer.parseInt(result);
    }
    
    @SuppressWarnings("unchecked")
    public List<StorageShowBean> queryForStorageList(StorageParameBean storageParameBean)
    {
        return (List<StorageShowBean>)parasolSQLSuport.queryForList("storage.queryForStorageList", storageParameBean);
    }
    
    public void saveForStorage(StorageBean storageBean)
    {
        parasolSQLSuport.insert("storage.saveForStorage", storageBean);
    }
    
    public void updateForStorage(StorageBean storageBean)
    {
        parasolSQLSuport.update("storage.updateForStorage", storageBean);
    }

    public StorageBean queryForSpecificationsid(String storageid)
    {
        return (StorageBean)parasolSQLSuport.queryForObject("storage.queryForSpecificationsid", storageid);
    }

    @Override
    public int queryForStorageListCount(StorageParameBean storageParameBean)
    {
        String result = String.valueOf(parasolSQLSuport.queryForObject("storage.queryForStorageListCount", storageParameBean));
        return Integer.parseInt(result);
    }
    
}
